<?php

/**
 * Created by PhpStorm.
 * User: yanshinian@yeah.net
 * Date: 2019/5/22
 * Time: 17:51.
 * jd.union.open.goods.query
 */
class UnionOpenPromotionBysubunionidGetRequest
{
    /**
     * @var String  推广物料  https://item.jd.com/23484023378.html
     */
    private $materialId;
    /**
     * @var int  推广位id
     */
    private $positionId ;
    /**
     * @var String  子联盟ID（需要联系运营开通权限才能拿到数据）
     */
    private $subUnionId;
    /**
     * @var String   联盟子站长身份标识，格式：子站长ID_子站长网站ID_子站长推广位ID
     */
    private $pid;
    /**
     * @var String  优惠券领取链接，在使用优惠券、商品二合一功能时入参，且materialId须为商品详情页链接
     */
    private $couponUrl;
    /**
     * @var String   转链类型，1：长链， 2 ：短链 ，3： 长链+短链，默认短链
     */
    private $chainType;
    /**
     * @var String  礼金批次号
     */
    private $giftCouponKey;


    private $apiParas = array();

    public function setMaterialId($materialId)
    {
        $this->materialId = $materialId;
        $this->apiParas['materialId'] = $materialId;
    }

    public function getMaterialId()
    {
        return $this->materialId;
    }

    public function setPositionId($positionId)
    {
        $this->positionId = $positionId;
        $this->apiParas['positionId'] = $positionId;
    }

    public function getPositionId()
    {
        return $this->positionId;
    }

    public function setSubUnionId($subUnionId)
    {
        $this->subUnionId = $subUnionId;
        $this->apiParas['subUnionId'] = $subUnionId;
    }

    public function getSubUnionId()
    {
        return $this->subUnionId;
    }

    public function setPid($pid)
    {
        $this->pid = $pid;
        $this->apiParas['pid'] = $pid;
    }

    public function getPid()
    {
        return $this->pid;
    }

    public function setCouponUrl($couponUrl)
    {
        $this->couponUrl = $couponUrl;
        $this->apiParas['couponUrl'] = $couponUrl;
    }

    public function getCouponUrl()
    {
        return $this->couponUrl;
    }

    public function setChainType($chainType)
    {
        $this->chainType = $chainType;
        $this->apiParas['chainType'] = $chainType;
    }

    public function getChainType()
    {
        return $this->chainType;
    }


    public function setGiftCouponKey($giftCouponKey)
    {
        $this->giftCouponKey = $giftCouponKey;
        $this->apiParas['giftCouponKey'] = $giftCouponKey;
    }

    public function getGiftCouponKey()
    {
        return $this->giftCouponKey;
    }


    public function getApiMethodName()
    {
        return 'jd.union.open.promotion.bysubunionid.get';
    }

    public function getApiParas()
    {
        return array('promotionCodeReq' => $this->apiParas);
    }

    public function check()
    {
        RequestCheckUtil::checkNotNull($this->materialId,"materialId");
    }

    public function putOtherTextParam($key, $value)
    {
        $this->apiParas[$key] = $value;
        $this->$key = $value;
    }
}
